home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindspring.com!usenet
- From: rudd@mindspring.com (Justin Rudd)
- Newsgroups: comp.lang.c++
- Subject: Re: Accessing base methods?
- Date: Fri, 15 Mar 1996 17:48:52 GMT
- Organization: MindSpring Enterprises
- Message-ID: <4icajt$lj6@B1FF.mindspring.com>
- References: <RobTerrell-1503961232280001@slip129-37-240-94.nc.us.ibm.net>
- Reply-To: rudd@mindspring.com
- NNTP-Posting-Host: rudd.mindspring.com
- X-Newsreader: Forte Free Agent v0.55
-
- RobTerrell@vmedia.com (Rob Terrell) wrote:
-
-
- >I'm just coming back to C++ after a 6-year absence...and I'm trying to
- >figure out how to access the base methods of a derived class.
-
- Welcome back :-)
-
- >Take this class:
-
- OK...but where do you want me to take it???
-
- Heheheh...sorry couldn't resist...been watching Laurel and Hardy all
- morning :-)
-
- >class base {
-
- > virtual void Move();
- >}
-
- >class derived : public base {
-
- > void Move();
- >}
-
-
- >Okay, so when I'm in the method....
-
-
- >void derived::Move()
- >{
-
- > // do stuff here
-
- > // Now I want to call the base class' Move
-
- //Try this
- base::Move();
- ^^^^^^^^^^^
-
- >}
-
- [snip]
-
- Justin
-
-